package demo1;

public class Student {
    private String name;
    private String gender;
    private int age;
    private double score;
    private static int classRoom = 112;

    public Student(String name, String gender, int age, double score) {
        this.name = name;
        this.gender = gender;
        this.age = age;
        this.score = score;
    }
    //静态方法
    public static int getClassRoom(){
        return classRoom;
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public double getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }
}
class Test{
    public static void main(String[] args) {
        Student s1 = new Student("zhangsan","nan",18, 2.7);
        Student s2 = new Student("lisi","nan",19, 2.0);
        Student s3 = new Student("wangwu","nv",20, 2.6);
        System.out.println(Student.getClassRoom());
        System.out.println(s1.getClassRoom());
    }

}
